package org.lab.service;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;

public class UrlForward {
	private Logger log;
	
	public UrlForward() {
		log = Logger.getLogger(UrlForward.class);
	}
	/**
	 * 页面转发
	 * @param url
	 * @param req HttpServletRequest
	 * @param resp HttpServletResponse
	 * @throws ServletException
	 * @throws IOException
	 * @author 李晓娜
	 * Apr 14, 2009
	 */
	public boolean forward(String url, HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException{
		log.info("页面转发至："+url);
		
		RequestDispatcher rd = req.getRequestDispatcher(url);
		rd.forward(req, resp);
		return true;
	}
	
	
}
